//
//  JLApiCenter.swift
//  JLApiCenter
//
//  Created by Jiang Chencheng on 2024/7/31.
//

import Foundation
import Alamofire

public enum JLApiCenter {}


public extension JLApiCenter {
    
    static func request<T: Codable>(_ request: JLRequestable) async throws -> T {
        let value = try await AF.request(request)
            .serializingDecodable(T.self)
            .value
        return value
    }
    
    static func request<T: Codable>(_ request: JLRequest) async throws -> T {
        let value = try await AF.request(request)
            .serializingDecodable(T.self)
            .value
        return value
    }
    
}

